//
//  CYHUD+Config.m
//  CYBaseKit
//
//  Created by admin on 2022/10/8.
//

#import "CYHUD+Config.h"

#import "SVProgressHUD.h"

@implementation CYHUD (Config)
/**
 * HUD的显示状态
 */
+ (void)resetHUDDefaultStyle {
    [SVProgressHUD setContainerView:nil];
    [SVProgressHUD resetOffsetFromCenter];
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    [SVProgressHUD setCornerRadius:5];
    [SVProgressHUD setDefaultAnimationType:SVProgressHUDAnimationTypeNative];
}

+ (void)resetHUDInViewStyleWithInView:(UIView *)inView {
    [self resetHUDDefaultStyle];
    if (inView) {
        [SVProgressHUD setContainerView:inView];
        UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
        CGFloat x_d = inView.frame.size.width - window.frame.size.width;
        CGFloat y_d = inView.frame.size.height - window.frame.size.height;
        [SVProgressHUD setOffsetFromCenter:UIOffsetMake(x_d, y_d)];
    }
}

+ (void)configHUDStatusStyle {
    [self resetHUDDefaultStyle];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
}

@end
